<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./LogInTemplate.xhtml">

            <ui:define name="top">
                <p:panel>
                    <br/>
                    <h1>
                        Create/Edit Course
                    </h1>
                    <br/>
                    <br/>
                </p:panel>
            </ui:define>

            <ui:define name="content">
                <f:view>
                    <h:form>
                        <p:panel>
                            <p:growl/>
                            <h:panelGrid columns="2">
                                <p:outputLabel value="Name:" for="name" />
                                <p:inputText id="name" value="#{courseBean.course.name}" 
                                title="Name" required="true" requiredMessage="The Name field is required." 
                                validatorMessage="Incorrect: Name only accept letter or/and numbers, Example: 'Guitar Amateur' or 'Guitar 1'">
                                    <f:validateRegex pattern="^[A-Za-z\s]+(\d)?$"/>
                                    <p:tooltip for="name" value="Name of the new Course..."/>
                                </p:inputText>
                            </h:panelGrid>
                            <p:commandButton value="Accept" action="ConfirmCourse" ajax="false"/>
                            <p:commandButton value="Cancel" action="CourseList" immediate="true"/>
                        </p:panel>
                    </h:form>
                </f:view>
            </ui:define>
        </ui:composition>
    </body>
</html>
